package com.sg.controller.bff;

import com.sg.service.biz.bff.SchemeOpenRecordService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "SchemeOpenRecord", tags = {"SchemeOpenRecord"})
@RestController
// @RequestMapping("/oms/schemeOpenRecord/")
public class SchemeOpenRecordController {

    @Autowired
    SchemeOpenRecordService schemeOpenRecordService;


    /**
     * B2-3查询应用实例配置关系列表(边界)
     * gen by moon at 11/9/2022, 1:02:19 AM
     */
    @PostMapping("/oms/schemeOpenRecord/queryApplexConrelListBorder")
    @ApiOperation(value = "B2-3查询应用实例配置关系列表(边界)", response = OkrResult.class)
    public OkrResult<BffQueryApplexConrelListBorderRespDto> queryApplexConrelListBorder(@RequestBody(required = false) @Validated BffQueryApplexConrelListBorderReqDto reqDTO) {
        return OkrResult.success(schemeOpenRecordService.queryApplexConrelListBorder(reqDTO));
    }


    /**
     * B2-3查询主题方案开通记录列表(边界)
     */
    @PostMapping("/oms/schemeOpenRecord/queryThemeSchemeOpenRecordListBorder")
    @ApiOperation(value = "B2-3查询主题方案开通记录列表(边界)", response = OkrResult.class)
    public OkrResult<BffQueryThemeSchemeOpenRecordListBorderRespDto> queryThemeSchemeOpenRecordListBorder(@RequestBody(required = false) @Validated BffQueryThemeSchemeOpenRecordListBorderReqDto reqDTO) {
        return OkrResult.success(schemeOpenRecordService.queryThemeSchemeOpenRecordListBorder(reqDTO));
    }

    /**
     * B2-3发布方案开通记录(管理)
     * gen by moon at 8/17/2022, 7:39:41 PM
     */
    @PostMapping("/oms/mgt/schemeOpenRecord/releaseSchemeOpenRecord")
    @ApiOperation(value = "B2-3发布方案开通记录(管理)", response = OkrResult.class)
    public OkrResult<BffReleaseSchemeOpenRecordRespDto> releaseSchemeOpenRecord(@RequestBody(required = false) @Validated BffReleaseSchemeOpenRecordReqDto reqDTO) {
        return OkrResult.success(schemeOpenRecordService.releaseSchemeOpenRecord(reqDTO));
    }

    /**
     * B2-3更新方案开通记录(管理)
     * gen by moon at 9/13/2022, 6:23:43 PM
     */
    @PostMapping("/oms/mgt/schemeOpenRecord/refreshSchemeOpenRecord")
    @ApiOperation(value = "B2-3更新方案开通记录(管理)", response = OkrResult.class)
    public OkrResult<BffRefreshSchemeOpenRecordRespDto> refreshSchemeOpenRecord(@RequestBody(required = false) @Validated BffRefreshSchemeOpenRecordReqDto reqDTO) {
        return OkrResult.success(schemeOpenRecordService.refreshSchemeOpenRecord(reqDTO));
    }

    /**
     * B2-3新增模板方案配置关系(管理)
     * gen by moon at 10/19/2022, 6:44:40 AM
     */
    @PostMapping("/oms/mgt/schemeOpenRecord/addTempSchemeConrel")
    @ApiOperation(value = "B2-3新增模板方案配置关系(管理)", response = OkrResult.class)
    public OkrResult<BffAddTempSchemeConrelRespDto> addTempSchemeConrel(@RequestBody(required = false) @Validated BffAddTempSchemeConrelReqDto reqDTO) {
        return OkrResult.success(schemeOpenRecordService.addTempSchemeConrel(reqDTO));
    }

    /**
     * B2-3删除模板方案配置关系(管理)
     * gen by moon at 10/14/2022, 2:16:26 PM
     */
    @PostMapping("/oms/mgt/schemeOpenRecord/deleteTempSchemeConrel")
    @ApiOperation(value = "B2-3删除模板方案配置关系(管理)", response = OkrResult.class)
    public OkrResult<BffDeleteTempSchemeConrelRespDto> deleteTempSchemeConrel(@RequestBody(required = false) @Validated BffDeleteTempSchemeConrelReqDto reqDTO) {
        return OkrResult.success(schemeOpenRecordService.deleteTempSchemeConrel(reqDTO));
    }
}
